﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CHPM.BL.Manager_sInterfaces;
using CHPM.BL.Managers;
using CHPM.Entities;
using CHPM.SL.TheService.Code;
using CHPM.IC.ServiceLocator;

namespace CHPM.SL.TheService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MainService" in code, svc and config file together.
    public class MainService : BaseService, IMainService
    {
        public MainService(IServiceLocator serviceLocator) : base(serviceLocator)
        {
        }

        public PATIENT GetPatientById(int id)
        {
            IPatientManager patientManager = new PatientManager();
            return patientManager.GetPatientById(id);
        }

        public List<PATIENT> GetAllPatients()
        {
            IPatientManager patientManager = new PatientManager();
            return patientManager.GetPatients();
        }

        public PATIENT InsertPatient(PATIENT newPatient)
        {
            IPatientManager patientManager = new PatientManager();
            return patientManager.InsertPatient(newPatient);
        }

        public PATIENT UpdatePatient(PATIENT newPatient)
        {
            IPatientManager patientManager = new PatientManager();
            return patientManager.EditPatient(newPatient);
        }
    }
}
